Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct ulimit nofile issue with brew #988

Merged
merged 1 commit into from
Mar 1, 2024
Merged

fix: correct ulimit nofile issue with brew #988

merged 1 commit into from
Mar 1, 2024

Conversation

bsherman
Copy link
Contributor

@bsherman bsherman commented Mar 1, 2024

brew install texlive was still failing with:
Error: Too many open files @ rb_sysopen

This sets a functional limits.conf soft nofile limit of 4096, but also sets the same default in systemd/user.conf which is required for the ulimit value to be respected in terminals running under Wayland/Xorg.

Relates: #670

`brew install texlive` was still failing with:
`Error: Too many open files @ rb_sysopen`

This sets a functional limits.conf soft nofile limit of 4096, but also
sets the same default in systemd/user.conf which is required for the
ulimit value to be respected in terminals running under Wayland/Xorg.

Relates: #670
@bsherman bsherman requested review from noelmiller and KyleGospo March 1, 2024 07:44
@bsherman bsherman requested a review from castrojo as a code owner March 1, 2024 07:44
@bsherman bsherman enabled auto-merge March 1, 2024 07:46
@KyleGospo
Copy link
Member

🛌

@fiftydinar
Copy link
Collaborator

Is my fix wrong?

@KyleGospo
Copy link
Member

Is my fix wrong?

Soft limit gets overridden by systemd, so your fix only applies to the hard limit which this isn't affected by.

@bsherman bsherman added this pull request to the merge queue Mar 1, 2024
Merged via the queue into main with commit 3911e57 Mar 1, 2024
30 checks passed
@bsherman bsherman deleted the fix-nofile branch March 1, 2024 08:30
@bsherman
Copy link
Contributor Author

bsherman commented Mar 1, 2024

Is my fix wrong?

I did some testing because there were still reports of the error in PR description/commit message.

I didn't realize there had already been commits to address it, but no, sadly, your fix had not resolved the issue.

Your fix worked for a user logged in at a console tty or via SSH 😀, but not for users using Bluefin's default bash shell via Ptyxis or gnome-terminal under gnome.

I discovered that in this scenario, systemd is playing a primary role setting nofile rather than pam_limits. There is some interplay with the two. For example, I could get pam_limits to raise or lower the hard nofile limit so that it differs from systemd's default. However, I could NOT get pam_limits to raise the soft nofile limit, only reduce it.

In addition, it seems slightly dangerous to raise the soft limit to equal the hard limit, so I did remove those lines in the brew-limits.conf.

RoyalOughtness pushed a commit to secureblue/secureblue that referenced this pull request Mar 15, 2024
* fix: Assure that "disabling CoreDump tweak" is applied correctly

Since Fedora uses systemd, we need to make this change too, else it won't be applied throughout the system, but only in SSH/TTY sessions.

Bluefin had the same issue with open-file limits tweak here:
ublue-os/bluefin#988

I usually put those config overrides to `/usr/lib`, but I will put them in `/usr/etc` to comply with the project's structure.

As far as I look, this is the only tweak which needs this systemd conf change.

* fix: Assure that "disabling CoreDump tweak" is applied correctly

Since Fedora uses systemd, we need to make this change too, else it won't be applied throughout the system, but only in SSH/TTY sessions.

Bluefin had the same issue with open-file limits tweak here:
ublue-os/bluefin#988

I usually put those config overrides to `/usr/lib`, but I will put them in `/usr/etc` to comply with the project's structure.

As far as I look, this is the only tweak which needs this systemd conf change.

Signed-off-by: fiftydinar <65243233+fiftydinar@users.noreply.github.com>

---------

Signed-off-by: fiftydinar <65243233+fiftydinar@users.noreply.github.com>
awesomekyle pushed a commit to awesomekyle/bluefin that referenced this pull request Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants